<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<jsp:include page="../../common/jsp/taglibs.jsp"/>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>新增/修改人员信息</title>
    <jsp:include page="../../common/jsp/head.jsp"/>
    <link href="${ctx}css/public.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<input id="type" type="hidden" value='${type}'/>
<input id="companyIdtemp" type="hidden" value='${companyId}'/>
<input id="groupIdtemp" type="hidden" value='<s:property value="user.groupId"/>'>
<input id="roleIdtemp" type="hidden" value='<s:property value="user.roleId"/>'>
<input id="userId" type="hidden" value='<s:property value="user.id"/>'>
<form class="layui-form">
    <table class="layui-table">
        <tr>
            <td>
                <div class="layui-form-item">
                    <label class="layui-form-label"><em>*</em>用户名</label>
                    <div class="layui-input-inline">
                        <input id="userName" type="text" lay-verify="verifyUserName" placeholder="请输入用户名"
                               class="layui-input" value='<s:property value="user.userName"/>' size="20" maxlength="20">
                    </div>
                </div>
            </td>
            <td>
                <div class="layui-form-item">
                    <label class="layui-form-label"><em>*</em>登录名</label>
                    <div class="layui-input-inline">
                        <input id="loginName" type="text" lay-verify="verifyLoginName" placeholder="请输入登录名"
                               class="layui-input" value='<s:property value="user.loginName"/>' size="20"
                               maxlength="20">
                    </div>
                </div>
            </td>
        </tr>
        <s:if test="type!='update'">
            <tr>
                <td>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><em>*</em>登录密码</label>
                        <div class="layui-input-inline">
                            <input id="newPass" type="password" lay-verify="verifyNewPass" placeholder="请输入密码"
                                   class="layui-input" value='<s:property value="user.loginPass"/>' size="18"
                                   maxlength="18">
                        </div>
                    </div>
                </td>
                <td>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><em>*</em>确认密码</label>
                        <div class="layui-input-inline">
                            <input id="queryPass" type="password" lay-verify="verifyNewConPass" placeholder="请输入确认密码"
                                   class="layui-input" value='<s:property value="user.loginPass"/>' size="18"
                                   maxlength="18">
                        </div>
                    </div>
                </td>
            </tr>
        </s:if>
        <tr>
            <td colspan="2">
                <div class="layui-form-item">
                    <label class="layui-form-label"><em>*</em>公司</label>
                    <div class="layui-input-block">
                        <s:if test="type!='update'">
                            <select id="companyId" lay-verify="verifyCompany" lay-filter="changeCompany">
                                <option value="">请选择公司</option>
                            </select>
                        </s:if>
                        <s:else>
                            <div style="padding-top: 9px;padding-left: 10px;"><s:property value="companyName"/></div>
                        </s:else>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="layui-form-item">
                    <label class="layui-form-label"><em>*</em>部门</label>
                    <div class="layui-input-inline">
                        <select id="groupId" lay-verify="verifyGroup">
                            <option value="">请选择部门</option>
                        </select>
                    </div>
                </div>
            </td>
            <td>
                <div class="layui-form-item">
                    <label class="layui-form-label"><em>*</em>角色</label>
                    <div class="layui-input-inline">
                        <select id="roleId" lay-verify="verifyRole">
                            <option value="">请选择角色</option>
                        </select>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="layui-form-item">
                    <label class="layui-form-label"><em>*</em>手机</label>
                    <div class="layui-input-inline">
                        <input id="cellphone" type="text" lay-verify="verifyPhone" placeholder="请输入正确手机号"
                               class="layui-input" onblur="validatePhone();" size="13" maxlength="13"
                               value='<s:property value="user.cellphone"/>'
                               onkeyup="this.value=this.value.replace(/\D/g,'')"
                               onafterpaste="this.value=this.value.replace(/\D/g,'')">
                    </div>
                </div>
            </td>
            <td>
                <div class="layui-form-item">
                    <label class="layui-form-label">电话</label>
                    <div class="layui-input-inline">
                        <input id="telephone" type="text" lay-verify="verifyTele" class="layui-input"
                               size="15" maxlength="15" value='<s:property value="user.telephone"/>'
                               onkeyup="this.value=this.value.replace(/[^\d-]/g,'')"
                               onafterpaste="this.value=this.value.replace(/[^\d-]/g,'')">
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="layui-form-item">
                    <label class="layui-form-label">性别</label>
                    <div class="layui-input-inline">
                        <input type="hidden" id="sexTemp" value='<s:property value="user.sex"/>'/>
                        <input type="radio" name="sex" value="0" title="女"/>
                        <input type="radio" name="sex" value="1" title="男"/>
                    </div>
                </div>
            </td>
            <td>
                <div class="layui-form-item">
                    <label class="layui-form-label">年龄</label>
                    <div class="layui-input-inline">
                        <input id="age" type="text" class="layui-input"
                               size="3" maxlength="3" value='<s:property value="user.age"/>'
                               onkeyup="this.value=this.value.replace(/\D/g,'')"
                               onafterpaste="this.value=this.value.replace(/\D/g,'')">
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <div class="layui-form-item">
                    <label class="layui-form-label">邮箱</label>
                    <div class="layui-input-block">
                        <input id="email" type="text" lay-verify="verifyEmail" class="layui-input"
                               value='<s:property value="user.email"/>' size="40" maxlength="40">
                    </div>
                </div>
            </td>
        </tr>
    </table>
    <div class="layui-form-item">
        <div class="layui-input-inline" style="float:right;margin-top:25px;">
            <a style="float: right;" class="layui-btn layui-btn-primary close">取消</a>
            <a id="submit" style="float: right; margin-right: 15px;" class="layui-btn" lay-submit
               lay-filter="submit">提交</a>
        </div>
    </div>
</form>
</body>
</html>
<script type="text/javascript" src="${ctx}common/js/closeAndRefresh.js?version=${version}"></script>
<script type="text/javascript" src="${ctx}js/user/addOrUpdateUser.js?version=${version}"></script>